package com.xoa.dao.document;

import com.xoa.model.document.*;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface DocumentModelMapper {

    int deleteByPrimaryKey(DocumentModelWithBLOBs id);

    int insert(DocumentModelWithBLOBs record);

    int insertSelective(DocumentModelWithBLOBs record);

    DocumentModelWithBLOBs selectByPrimaryKey(DocumentModelWithBLOBs id);

    int updateByPrimaryKeySelective(DocumentModelWithBLOBs document);

    int updateByPrimaryKeyWithBLOBs(DocumentModelWithBLOBs document);

    int updateByPrimaryKey(DocumentModelWithBLOBs document);

    List<DocumentModelWithBLOBs> selectDocAll(DocumentModelWithBLOBs document);


    int countByExample(DocumentModelExample example);


    int deleteByExample(DocumentModelExample example);


    int deleteByPrimaryKey(Integer id);


    List<DocumentModelWithBLOBs> selectByExampleWithBLOBs(Map<String, Object> example);


    List<DocumentModelWithBLOBs> selectByExample(DocumentModelExample example);


    DocumentModelWithBLOBs selectByPrimaryKey(Integer id);


    int updateByExampleSelective(DocumentModelWithBLOBs record);


    int updateByExampleWithBLOBs(DocumentModelWithBLOBs record);


    int updateByExample(DocumentModelWithBLOBs record);

    int updateByPrimaryKey(DocumentModel record);

    List<DocumentModelWithBLOBs> seleDocSendReceive(Map<String, Object> maps);

    /**
     * 创建作者:   杨 胜
     * 创建日期:   2017-7-28 上午11:13:22
     * 方法介绍:   公文查询
     * 参数说明:   @param document
     *
     * @return List<DocumentModelWithBLOBs>
     */
    List<DocumentModelWithBLOBs> selectDocSelective(DocumentModelWithBLOBs document);

    List<DocumentModelFlowRunPrcs> selWillDocSendOrReceive(Map<String, Object> param);

    //根据 传阅人查询已结束的公文信息
    List<DocumentModelOverRun> selWillDocSendOrReceivedz(Map<String, Object> param);

    Integer selWillDocSendOrReceiveCounts(Map<String, Object> param);

    List<DocumentModelOverRun> selOverDocSendOrReceive(Map<String, Object> param);

    Integer selOverDocSendOrReceiveCounts(Map<String, Object> param);

    List<DocumentModelFlowRunPrcs> selMyDocSendOrReceive(Map<String, Object> param);

    Integer selMyDocSendOrReceiveCounts(Map<String, Object> param);


    List<DocumentModelFlowRunPrcs> selOverseeTheOfficialDocument(Map<String, Object> param);

    DocumentModel getDocumentEditPriv(@Param("id") Integer id);


    List<DocumentModelFlowRunPrcs> querySelectDoc(Map<String,Object> param);

    /**
     * 作者: 张航宁
     * 日期: 2017/9/26
     * 说明: 查询有时限的公文信息
     */
    List<DocumentModelFlowRunPrcs> selectTimeOutDoc(Map<String, Object> param);

    List<DocumentModelFlowRunPrcs> selDocByTitle(Map<String, Object> param);

    DocumentModel checkRunId(Integer runId);

    DocumentModelWithBLOBs checkRunIds(Integer runId);

    List<DocumentModelFlowRunPrcs> selWillDocSendOrReceiveNotOrderBy(Map<String, Object> param);

    List<DocumentModelFlowRunPrcs> selWillDocSendOrReceiveCount(Map<String, Object> param);
    //直接上传pdf后将其他三个正文字段数据清除
    int setMainFile(@Param("id") Integer id);
    //直接上传word文件后将pdf和修订文件对应的字段清除
    int clearMainpdf(@Param("id") Integer id);

    List<Map<String,Object>> SupervisionStatistics(Map map);

    Integer SupervisionStatisticsCount(Map map);

    @Select("update document set title = #{title} where run_id = #{runId}")
    Integer updateDocumentTitle(@Param("title") String title,@Param("runId") Integer runId);

    int updateByRunId(Map<String, Object> map);
}